package datastructure.linkedlist;

public class LLExecise {

	int size(SLLNode head){
//		return size1(head);
		return size2(head);
	}
	
	static int size1(SLLNode head){		//���
		int count = 0;
		
		for(SLLNode curr = head; curr != null; curr = curr.next)
			count++;
		return count;
	}
	static int size2(SLLNode head){		//�ݹ鷨
		if(head == null)
			return 0;
		return size2(head.next)+1;
	}
	
	public static void main(String[] args) {
		

	}

}
